package com.tfswue.lhj.listener;

import org.springframework.context.event.EventListener;
import com.tfswue.lhj.event.UserRegisteredEvent;
import com.tfswue.lhj.service.UserService;
import org.springframework.stereotype.Component;

@Component
public class UserEventListener implements ApplicationListener<UserRegisteredEvent> {

    private static final Logger logger = LoggerFactory.getLogger(UserEventListener.class);
    @Override
    public void onApplicationEvent(UserRegisteredEvent event) {
        // 处理用户事件
        logger.info("记录用户注册日志：{} | {}",
            event.getUsername(),event.getEmail())   ;
        // 可以在这里添加更多的业务逻辑
    }
}
